package cn.tedu.scc.controller;

import cn.tedu.scc.entity.Member;
import cn.tedu.scc.mapper.MemberMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MemberController {

    @Autowired
    MemberMapper mapper;

    @RequestMapping("/member/select")
    public List<Member> select(){
        return mapper.select();
    }

    @RequestMapping("/member/insert")
    public void insert(String name){
        mapper.insert(name);
    }

    @RequestMapping("/member/deleteById")
    public void deleteById(int id){
        mapper.deleteById(id);
    }
}
